 var dokArray = document.assocs["rcc:perPazAttachments"];
 var person = document.assocs["rcc:perPazRegistrator"][0];
var name = person.properties["{http://www.alfresco.org/model/content/1.0}firstName"];
var lname = person.properties["{http://www.alfresco.org/model/content/1.0}lastName"];
var registrator = name+" "+lname;
 var dok = null;
 if (dokArray!=null){
	for (var i=0;i<dokArray.length;i++){
		dok = document.assocs["rcc:perPazAttachments"][i];
		if (dok.type!="{http://appdevel?.kada.lt/model/content/1.0}veiklosDokumentas") dok.specializeType("rcc:veiklosDokumentas");
		dok.properties["rcc:dokRegNum"] = document.properties["rcc:perPazRegNumeris"];
		dok.properties["rcc:dokRegDat"] = document.properties["rcc:perPazRegData"];
		dok.properties["rcc:dokTip"] = "1108";
		dok.properties["rcc:grup"] = "Vidiniai";
		dok.properties["cm:title"] = document.properties["rcc:perPazRegTitle"];
		dok.properties["rcc:dokRegAsmVarPav"] = registrator;
		dok.properties["rcc:adresatas"] = document.properties["rcc:perPazGavPav"];
		dok.save();
	}
}